<?php
SESSION_START();
header("content-type:text/html;charset=utf-8");

date_default_timezone_set("PRC");
require_once("connetMysql.class.php"); 
$db=new connetMysql;
$con=$db->getConnect();

$commentnewsid=$_POST['newsid'];
$ifzan_jubao=$_POST['zanjubao'];
//$commentnewsid=10;
//$ifzan_jubao="1";
if($ifzan_jubao=="1"){
	$sql="UPDATE `comment` SET commentpraisetimes=commentpraisetimes+1 WHERE commentID='$commentnewsid'";	
	if (!mysqli_query($con,$sql))
  	{
  		die('Error: ' . mysqli_error());
 	}
	echo "1";
}
else{
	$sql="UPDATE `comment` SET commentreporttimes=commentreporttimes+1 WHERE commentID='$commentnewsid'";	
	if (!mysqli_query($con,$sql))
  	{
  		die('Error: ' . mysqli_error());
 	}
	echo "2";
}
?>